
clear all 

gl Inputs "$folder\1_Inputs"
gl Intermediate "$folder\2_Intermediate"
gl Outputs "$folder\3_Outputs"

********************************************************************************
********************************************************************************
**# TABLE G.10

use "${Intermediate}\Combined for forloops.dta", clear

gen keeping = 1 if inlist(outcome, "move", "eshu", "home", "earn", "empl")
replace keeping = 1 if inlist(outcome, "inde", "cred", "zero", "deli", "auto")
keep if keeping==1 
drop keeping
keep if inlist(spec, "iv11", "ivac")
keep if inlist(time, "q0104")
drop if group=="gr0" | group=="gr1"

levelsof outcome, local(outcomes)
levelsof group, local(groups)
levelsof spec, local(specs)
levelsof time, local(times)
levelsof geo, local(geos)
levelsof item, local(items)

foreach outx in `outcomes' {
	local id1 = "`outx'"
	
	foreach grox in `groups' {
		local id2 = "`grox'"
		
		foreach spex in `specs' {
			local id3 = "`spex'"
			
			foreach timx in `times' {
				local id4 = "`timx'"
				
				foreach geox in `geos' {
					local id5 = "`geox'"
					
					foreach itex in `items' {
						local id6 = "`itex'"
		
					levelsof value if 	outcome=="`outx'" & ///
										group=="`grox'" & ///
										spec=="`spex'" & ///
										time=="`timx'" & ///
										geo=="`geox'" & ///
										item=="`itex'" , ///
						clean local(`id1'_`id2'_`id3'_`id4'_`id5'_`id6')
						di "`id1'_`id2'_`id3'_`id4'_`id5'_`id6'"
						
					}
				}
			}
		}
	}
}

				
gl x " "

texdoc init "${Outputs}/Supplementary data_Table_G10.tex", replace force
tex {\footnotesize \begin{tabular}{l c c} \hline \toprule ///	
 & & IV with Amount \\
tex & IV & Stringency \\
tex & & Control  \\

tex & (1) & (2) \\
tex \cline{2-3}


tex \textbf{\underline{Housing:}} & & \\
tex $x ~~~Not at eviction address 	& `move_a_ivac_q0104_c_co' & `move_a_iv11_q0104_c_co' \\
tex 								& `move_a_ivac_q0104_c_se' & `move_a_iv11_q0104_c_se' \\
tex 								&  [`move_a_ivac_q0104_c_obs'] & [`move_a_iv11_q0104_c_obs'] \\
tex & & \\
tex $x ~~~Emergency shelter 		& `eshu_a_ivac_q0104_c_co' & `eshu_a_iv11_q0104_c_co' \\
tex 								& `eshu_a_ivac_q0104_c_se' & `eshu_a_iv11_q0104_c_se' \\
tex 								&  [`eshu_a_ivac_q0104_c_obs'] & [`eshu_a_iv11_q0104_c_obs'] \\
tex & & \\
tex $x ~~~Any homelessness services & `home_a_ivac_q0104_c_co' & `home_a_iv11_q0104_c_co' \\
tex 								& `home_a_ivac_q0104_c_se' & `home_a_iv11_q0104_c_se' \\
tex 								&  [`home_a_ivac_q0104_c_obs'] & [`home_a_iv11_q0104_c_obs'] \\
tex \midrule
tex \textbf{\underline{Labor Market:}} & & \\
tex $x ~~~Earnings 				& `earn_a_ivac_q0104_c_co' & `earn_a_iv11_q0104_c_co' \\
tex 							& `earn_a_ivac_q0104_c_se' & `earn_a_iv11_q0104_c_se' \\
tex 							&  [`earn_a_ivac_q0104_c_obs'] & [`earn_a_iv11_q0104_c_obs'] \\
tex & & \\
tex $x ~~~Employment 			& `empl_a_ivac_q0104_c_co' & `empl_a_iv11_q0104_c_co' \\
tex 							& `empl_a_ivac_q0104_c_se' & `empl_a_iv11_q0104_c_se' \\
tex 							&  [`empl_a_ivac_q0104_c_obs'] & [`empl_a_iv11_q0104_c_obs'] \\

tex \midrule 
tex \textbf{\underline{Financial Health:}} & & \\
tex $x ~~~Financial health index & `inde_a_ivac_q0104_c_co' & `inde_a_iv11_q0104_c_co' \\
tex 							& `inde_a_ivac_q0104_c_se' & `inde_a_iv11_q0104_c_se'  \\
tex 							&  [`inde_a_ivac_q0104_c_obs'] & [`inde_a_iv11_q0104_c_obs'] \\

tex & & \\
tex $x ~~~Credit score 			& `cred_a_ivac_q0104_c_co' & `cred_a_iv11_q0104_c_co' \\
tex 							& `cred_a_ivac_q0104_c_se' & `cred_a_iv11_q0104_c_se' \\
tex 							&  [`cred_a_ivac_q0104_c_obs'] & [`cred_a_iv11_q0104_c_obs'] \\

tex & & \\
tex $x ~~~No open revolving account & `zero_a_ivac_q0104_c_co' & `zero_a_iv11_q0104_c_co' \\
tex 							& `zero_a_ivac_q0104_c_se' & `zero_a_iv11_q0104_c_se' \\
tex 							&  [`zero_a_ivac_q0104_c_obs'] & [`zero_a_iv11_q0104_c_obs'] \\

tex & & \\
tex $x ~~~Total balance: collections and delinquencies & `deli_a_ivac_q0104_c_co' & `deli_a_iv11_q0104_c_co' \\
tex 							& `deli_a_ivac_q0104_c_se' & `deli_a_iv11_q0104_c_se' \\
tex 							&  [`deli_a_ivac_q0104_c_obs'] & [`deli_a_iv11_q0104_c_obs'] \\
 
tex & & \\
tex $x ~~~Any auto loan or lease & `auto_a_ivac_q0104_c_co' & `auto_a_iv11_q0104_c_co' \\
tex 							& `auto_a_ivac_q0104_c_se' & `auto_a_iv11_q0104_c_se' \\
tex 							&  [`auto_a_ivac_q0104_c_obs'] & [`auto_a_iv11_q0104_c_obs']  \\


 
tex \bottomrule \\
tex	\end{tabular} }
texdoc close
